package com.news.service.impl;


import com.news.dao.AdverDao;
import com.news.dao.impl.AdverDaoImpl;
import com.news.pojo.Adver;
import com.news.service.AdverService;

import java.util.List;

public class AdverServiceImpl implements AdverService {
   private AdverDao adverDao = new AdverDaoImpl();

    /**
     * 添加广告
     *
     * @param adver
     * @return
     */
    @Override
    public boolean addAdver(Adver adver) {
        return adverDao.addAdver(adver) == 1?true:false;
    }

    /**
     * 删除广告
     *
     * @param aid
     * @return
     */
    @Override
    public boolean delAdver(int aid) {
        return adverDao.delAdver(aid) == 1?true:false;
    }


    /**
     * 通过id查询广告
     *
     * @param aid
     * @return
     */
    @Override
    public boolean getAdverByAid(int aid) {
        return adverDao.getAdverByAid(aid) ==1?true:false;
    }

    /**
     * 查询所有广告
     *
     * @return
     */
    @Override
    public List<Adver> getAll() {
        return adverDao.getAll();
    }
}
